package com.lexed.jdbc;

import java.sql.PreparedStatement;
import java.sql.ResultSet;

import com.lexed.jdbc.util.Datebase;

public class DateBase {

	public static void main(String[] args) throws Exception {
		// PreparedStatement?
		// 1、加快计算速度
		// 2、使用简单
		// 3、防止注入式攻击
		PreparedStatement ps = 
				Datebase.getpreparedStatement("select * from emp where sal>?");
		
		ps.setDouble(1, 1000);
		
		ResultSet  resultSet = ps.executeQuery();
		
		while(resultSet.next()){
			System.out.println(resultSet.getString("ename"));
		}
		
		Datebase.close(ps, null, resultSet);
		
	}

}
